<template>
	<view class="list_box" :style="style_item">
		<view @click="navTo(item.id)" v-for="(item,index) in list" :key="index" class="list_box_item">
			<u-image  mode="aspectFit" border-radius="38" :fade="true" duration="450" width="100rpx" height="100rpx" :src="geshi(item.pic)" :lazy-load="true"></u-image>
			<view class="item_title">
				{{item.name}}
			</view>
		</view>
	</view>
</template>

<script>
	import mImg from '@/componts/m-img/index.vue';
	export default {
		components:{
		   mImg
		},
		props: {
			// 缺省图
			list:{
				type: Array,
				default: []
			},
			style_item: {
				type: Object,
				default: () => ({})
			},
		},
		data() {
			return {
				search_text:'',
				geshi:(pic)=>{
					return pic.replace(/\\/g , '/')
				}
			}
		},
		methods: {
			navTo(id){
				uni.setStorage({
					'key':'class_id',
					'data':id,
					success(){
						uni.switchTab({
							url:'/pages/classification/classification'
						})
					}
				})
				
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import url(./list.scss);
</style>